package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.dto.GenderCountDto;
import com.itheima.service.CountService;
import com.itheima.vo.GenderCountVo;
import com.itheima.vo.JopPeoCountVo;
import com.itheima.vo.StuCountVo;
import com.itheima.vo.StuDeqreeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
@Slf4j
public class CountController {
    @Autowired
    private CountService countService;

    @GetMapping("/empGenderData")
    public R count() {
        log.info("统计员工性别");
        List<GenderCountVo> vo = countService.count();
        return R.ok(vo);
    }
    @GetMapping("/empJobData")
    public R empJop(){
        log.info("统计员工职位人数");
       JopPeoCountVo vo =countService.jopCount();
       return R.ok(vo);
    }
    @GetMapping("/studentDegreeData")
    public R  stuDegree(){
        log.info("学员学历统计");
        List<StuDeqreeVo> vo  =countService.stuDegree();
        return R.ok(vo);

    }
    @GetMapping("/studentCountData")
    public R studentConunt(){
        log.info("统计班级人数");
        StuCountVo vo = countService.stuCount();
        return  R.ok(vo);
    }

}
